/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package controller;
import java.util.List;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceException;
import model.cliente.Cliente;
import model.fachada.Fachada;
import model.excecoes.ErroDAOException;
import model.excecoes.ErroNegocioException;
import model.interfaces.IControllerCliente;

/**
 *
 * @author Marcos
 */
public class ControllerCliente implements IControllerCliente{
    
   private Fachada fachada = null;
   
   public ControllerCliente(){
       fachada = Fachada.getInstanciaSingleton();
   }

    @Override
    public void cadastrarCliente(Cliente cliente) throws ErroDAOException, ErroNegocioException, PersistenceException, NoResultException {
        fachada.cadastrarCliente(cliente);
    }

    @Override
    public void alterarCliente(Cliente cliente) throws ErroDAOException, ErroNegocioException, PersistenceException, NoResultException {
        fachada.alterarCliente(cliente);
    }

    @Override
    public void excluirCliente(Cliente cliente) throws ErroDAOException, ErroNegocioException, PersistenceException, NoResultException {
        fachada.excluirCliente(cliente);
    }

    @Override
    public List<Cliente> listarCliente(String consulta, String campo) throws ErroDAOException, ErroNegocioException, PersistenceException, NoResultException {
        return fachada.listarCliente(consulta, campo);
    }

    @Override
    public boolean logarCliente(String login, String senha) throws ErroDAOException, ErroNegocioException, PersistenceException, NoResultException {
        return fachada.logarCliente(login, senha);
    }
    
}
